package com.northone.statistics.database;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class SaintDataBaseHelper extends SQLiteOpenHelper {

	public static final String TABLE_NAME_BASE = "base";
	public static final String TABLE_NAME_EXTEND = "extend";
	public static final String TABLE_NAME_METTING = "metting";
	public static final String TABLE_NAME_MONTH_ITEM = "month_item";
	public static final String TABLE_NAME_MONTH_OF_WEEK = "month_of_week";

	public SaintDataBaseHelper(Context context) {
		super(context, "statisdb", null, 1);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		db.execSQL("CREATE TABLE " + TABLE_NAME_BASE
				+ "(_id INTEGER PRIMARY KEY AUTOINCREMENT,name TEXT DEFAULT \"\",sex TEXT DEFAULT \"\",birthday TEXT DEFAULT \"\",baptism TEXT DEFAULT \"\",phone TEXT DEFAULT \"\",wechat TEXT DEFAULT \"\",Email TEXT DEFAULT \"\",type TEXT DEFAULT \"\",marriage TEXT DEFAULT \"\",native TEXT DEFAULT \"\",remark TEXT DEFAULT \"\")");
		db.execSQL("CREATE TABLE " + TABLE_NAME_EXTEND
				+ "(_id INTEGER PRIMARY KEY AUTOINCREMENT,name TEXT DEFAULT \"\",allhome TEXT DEFAULT \"\",family TEXT DEFAULT \"\",openhome TEXT DEFAULT \"\",oldaklxy TEXT DEFAULT \"\",nativetime TEXT DEFAULT \"\",gohome TEXT DEFAULT \"\")");
		db.execSQL("CREATE TABLE " + TABLE_NAME_METTING
				+ "(_id INTEGER PRIMARY KEY AUTOINCREMENT,name TEXT DEFAULT \"\",DayOfWeek TEXT DEFAULT \"\",StartTime TEXT DEFAULT \"\",EndTime TEXT DEFAULT \"\",Place TEXT DEFAULT \"\",Status TEXT DEFAULT \"\",Remark TEXT DEFAULT \"\")");
		db.execSQL("CREATE TABLE " + TABLE_NAME_MONTH_ITEM
				+ "(_id INTEGER PRIMARY KEY AUTOINCREMENT,month TEXT DEFAULT \"\",orderBy INTEGER,normalNum TEXT DEFAULT \"\",baptismNum TEXT DEFAULT \"\",morningRiseNum TEXT DEFAULT \"\",prayNum TEXT DEFAULT \"\",gospelerNum TEXT DEFAULT \"\",familyMettNum TEXT DEFAULT \"\",rankMeetNum TEXT DEFAULT \"\",sundayMeetNum TEXT DEFAULT \"\")");
		db.execSQL("CREATE TABLE " + TABLE_NAME_MONTH_OF_WEEK
				+ "(_id INTEGER PRIMARY KEY AUTOINCREMENT,month TEXT DEFAULT \"\",week INTEGER,normalNum INTEGER,baptismNum INTEGER,morningRiseNum INTEGER,prayNum INTEGER,gospelerNum INTEGER,familyMettNum INTEGER,rankMeetNum INTEGER,sundayMeetNum INTEGER)");
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
	}
}
